package com.lyc.type;

import com.lyc.entity.Poin;
import com.lyc.entity.Poin3;

/**
 * @author ：Xiaochen
 * @date ：Created in 2022/10/25 11:37
 * @description：
 * @modified By：
 * @version:
 */
public class Text3 {
    public static void main(String[] args) {
        Poin3<Integer> p1 = new Poin3<>();
        p1.setVar(66);
        fun(p1);

        Poin3<Number> p2 = new Poin3<>();
        p2.setVar(66.6);
        fun(p2);

        Poin3<String> p3 = new Poin3<>();
        p3.setVar("hello");
        fun2(p3);

        Poin3<Object> p4 = new Poin3<>();
        fun2(p4);

    }
    public static void fun(Poin3<? extends Number> poin3){
        poin3.show();
    }
    public static void fun2(Poin3<? super String> poin3){
        poin3.show();
    }
}